package com.atguigu.servlet;

import jakarta.servlet.RequestDispatcher;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;
@WebServlet("/servletA")
public class ServletA extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("servletA执行了");
        //请求转发给servletB

        //获得请求转发器
      /*  RequestDispatcher requestDispatcher = req.getRequestDispatcher("servletB");*/
/*
        RequestDispatcher requestDispatcher = req.getRequestDispatcher("WEB-INF/aaa.html");
*/
        //让请求转发器做出转发动作
        RequestDispatcher requestDispatcher = req.getRequestDispatcher("");

        requestDispatcher.forward(req,resp);
    }
}
